/**
 *  *2010-5-15 下午11:27:13  add 
 */
package com.base.myproject.client.HR.bcode;

import java.util.ArrayList;
import java.util.Date;

import com.base.myproject.client.busi.BaseStore;
import com.base.myproject.client.busi.LasyObejct;
import com.base.myproject.client.busi.BO.BusiObject;
import com.base.myproject.client.jdbc.DataSet;
import com.base.myproject.client.jdbc.StoreInfo;
import com.base.myproject.client.system.Env;
import com.base.myproject.client.tools.CommandFactory;
import com.base.myproject.client.tools.CommandSyncContainer;
import com.base.myproject.client.tools.CommandSyncReturnObject;
import com.base.myproject.client.tools.CommandSyncsql;
import com.base.myproject.client.tools.GreetingService;
import com.base.myproject.client.tools.GreetingServiceAsync;
import com.base.myproject.client.ui.BaseFormPanel;
import com.base.myproject.client.ui.celleditor.BaseComboBoxForm;
import com.base.myproject.client.ui.celleditor.BaseComboBoxX;
import com.base.myproject.client.ui.celleditor.BaseRadioGroup;
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.TableData;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

/**
 * 人力资源的雇用工作
 * 
 * @author Administrator 2010-5-15 javazgw@gmail.com
 */
public class Bcode_Employment extends LayoutContainer implements LasyObejct {

	BaseStore<BusiObject> mainstore = null;
	BaseComboBoxForm<BaseModelData> C_num27;//分部门
	BaseComboBoxForm<BaseModelData> C_dep ;//部门  
	BaseComboBoxForm<BaseModelData> C_num26 ;//工作组
	static  String W_date="";//类变量  用来保存入职日期  其他页面会用到处理问题
	DateField C_data9 ;//入职日期
	TextField<String> C_num25;//识别码
	TextField<String> C_num3;//雇佣编号
	BcodeMain main;//大管家
	
	public Bcode_Employment(BcodeMain main) {
		this.main = main;
		this.mainstore = main.getStore();
		init();
	}
	
	public Bcode_Employment() {
	}

	void init() {
		
		initwidget();

	}

	Widget initwidget() {

		FieldSet fs1 = new FieldSet();
		fs1.setHeading("部门");
		fs1.add(create_bcode_Form());
	//	fs1.setHeight(100);
		
		FieldSet fs2 = new FieldSet();
		fs2.add(createForm());
		fs2.setHeading("工作");
		fs2.setHeight(250);
		
		
		VerticalPanel v = new VerticalPanel();
		v.setSpacing(2);
		v.add(fs1);
		v.add(fs2);
		
		this.add(v);
		return null;
	}

	BaseStore<BusiObject> store = null;

	public BaseStore<BusiObject> getStore() {
		if (store == null) {
			createStore();
		}
		return store;
	}

	BaseStore<BusiObject> createStore() {
		ModelType type = new ModelType();
		type.setRoot("records");
		type.setRecordName("record");
		type.setTotalName("totle");
		type.addField("icode");
		type.getField("icode").setType(Long.class);
		type.addField("bcode");
		type.getField("bcode").setType(String.class);
		type.addField("employno");
		type.getField("employno").setType(String.class);
		type.addField("employstartdate");
		type.getField("employstartdate").setType(Date.class);
		type.addField("employlevel");
		type.getField("employlevel").setType(String.class);
		type.addField("employinnertitle");
		type.getField("employinnertitle").setType(String.class);
		type.addField("employoutertitle");
		type.getField("employoutertitle").setType(String.class);
		type.addField("employstatus");
		type.getField("employstatus").setType(String.class);
		type.addField("entrydate");
		type.getField("entrydate").setType(Date.class);
		type.addField("Regularizationdate");
		type.getField("Regularizationdate").setType(Date.class);
		type.addField("groupregularizationdate");
		type.getField("groupregularizationdate").setType(Date.class);
		type.addField("lastjobdate");
		type.getField("lastjobdate").setType(Date.class);
		type.addField("lastpaydate");
		type.getField("lastpaydate").setType(Date.class);
		type.addField("Resignationdate");
		type.getField("Resignationdate").setType(Date.class);
		type.addField("Insurancedate");
		type.getField("Insurancedate").setType(Date.class);
		type.addField("contractstartdate");
		type.getField("contractstartdate").setType(Date.class);
		type.addField("contractsenddate");
		type.getField("contractsenddate").setType(Date.class);
		type.addField("jobproperty");
		type.getField("jobproperty").setType(String.class);
		type.addField("jobgroup");
		type.getField("jobgroup").setType(String.class);
		type.addField("jobtype");
		type.getField("jobtype").setType(String.class);
		type.addField("paymethod");
		type.getField("paymethod").setType(String.class);
		type.addField("Vacation");
		type.getField("Vacation").setType(String.class);
		type.addField("boss");
		type.getField("boss").setType(String.class);
		type.addField("isMul");
		type.getField("isMul").setType(Integer.class);
		type.addField("lockersno");
		type.getField("lockersno").setType(String.class);
		type.addField("hostelno");
		type.getField("hostelno").setType(String.class);
		type.addField("attendancecardno");
		type.getField("attendancecardno").setType(String.class);
		type.addField("trainerfrom");
		type.getField("trainerfrom").setType(String.class);
		type.addField("Work_experience");
		type.getField("Work_experience").setType(Double.class);
		type.addField("isAttendance");
		type.getField("isAttendance").setType(Integer.class);
		type.addField("isCount");
		type.getField("isCount").setType(Integer.class);
		
		StoreInfo info = new StoreInfo();
		info.setTablename("bcode_job");
		info.setKeyname(new String[] { "icode" });
		info.setSql("select * from bcode_job where bcode='{bcode}'");

		info.setParent(mainstore);// 关联主表
		info.setLinkparentcolumns(new String[] { "bcode" }); // 关联主表字段
		info.setLinkparent_chile_columns(new String[] { "bcode" });// 关联主表字段
		store = new BaseStore<BusiObject>(type, info) {
			public void _LoadComplete()
			{
				super._LoadComplete();
				if (store.getValue("employstatus") == null) {
					setFormReadOnly(false);
					setReadOnly(true);
				} else if (store.getValue("employstatus").equals("在职")) {
					setFormReadOnly(false);
					setReadOnly(false);
				} else {
					setFormReadOnly(true);//只读
				}
				
				System.out.println("store.getValue === " + store.getValue("lockersno"));
				if (store.getValue("lockersno") == null || store.getValue("lockersno").equals("")) {
					C_num24.setEnabled(true);
				} else {
					C_num24.setEnabled(false);
				}
				
				if (store.getValue("jobtype") == null || !store.getValue("jobtype").equals("实习生")) {
					bcbTrainerFrom.setEnabled(false);
				} else {
					bcbTrainerFrom.setEnabled(true);
				}
 			}
		};
		
		return store; 
	}
	
	/**
	 * @param readOnly 设置在入职后一些字段是否只读的
	 * 设置一些入职后必须为只读的字段为只读，当然其它的字段还是可以修改,
	 * 如果员工为新添加的，那么所有字段都为可修改的
	 */
	private void setReadOnly(boolean readOnly) {
		C_dep.setEnabled(readOnly);
		C_num27.setEnabled(readOnly);
		C_num5.setEnabled(readOnly);
		in_work.setEnabled(readOnly);
		C_num20.setEnabled(readOnly);
		main.bcode_salary.C_num31.setEnabled(readOnly);
		if (Env.getEnvTitle().equals("人事-人力资源部经理")) {
			main.bcode_salary.modify.setEnabled(true);
		} else {
			main.bcode_salary.modify.setEnabled(false);  //不是人事经理的永远不能修改薪金
		}
	}
	
	
	
	/**
	 * @param readOnly 设置form的可读状态
	 * 根据员工的雇佣状态设置所有的FORM是否是可读的，刚添加的为所有的FORM都是可读的
	 * 离职的话则是所有为不可读，在职的话所有也为可读，但是有其中的一些字段为不可读
	 * 的，这个由setReadOnly(boolean)控制
	 * @see Bcode_Employment#setReadOnly(boolean)
	 */
	private void setFormReadOnly(boolean readOnly) {
		main.bcode_hr.form.setReadOnly(readOnly);
		main.bcode_salary.form.setReadOnly(readOnly);
		main.bcode_family.form.setReadOnly(readOnly);
		main.bcode_Contract.form.setReadOnly(readOnly);
		//main.employ.form.setReadOnly(readOnly);
		main.employ.form1.setReadOnly(readOnly);
		main.employ.form2.setReadOnly(readOnly);
		main.employ.form3.setReadOnly(readOnly);
		main.employ.form4.setReadOnly(readOnly);
		form.setReadOnly(readOnly);
		form1.setReadOnly(readOnly);
	}
	
	BaseFormPanel form = null;
	BaseComboBoxX in_work;
	BaseComboBoxX C_num24;//储物柜
	BaseComboBoxX bcbTrainerFrom = null;
	BaseComboBoxX C_num20 = null;//工作类别
	BaseComboBoxX C_num5;
	BaseComboBoxX C_num8;
	DateField C_data10;
	NumberField score;
	DateField C_data12;
	DateField C_data14;
	
	BaseFormPanel createForm() {
		form = new BaseFormPanel(getStore(),false);
		form.setBodyBorder(false);
		form.setPadding(6);
		form.setStyleName("form_css2");
		TableLayout tl = new TableLayout(6);

		TableData td = new TableData();
		td.setRowspan(1);
		td.setHorizontalAlign(HorizontalAlignment.LEFT);
		td.setVerticalAlign(VerticalAlignment.TOP);
		td.setPadding(2);
		form.setLayout(tl);
		form.setHeaderVisible(false);

		form.add(new Label("雇佣编号:"), td);
		C_num3 = new TextField<String>();
		C_num3.setFireChangeEventOnSetValue(true);
		C_num3.setName("employno");
		C_num3.setEnabled(false);
		form.add(C_num3, td);
		
		form.add(new Label("雇佣日期:"), td);
		DateField C_data4 = new DateField();
		C_data4.getPropertyEditor().setFormat(
				DateTimeFormat.getFormat("yyyy-MM-dd"));
		C_data4.setName("employstartdate");
		form.add(C_data4, td);
		
		form.add(new Label("雇佣级别:"), td);
		C_num5 = new BaseComboBoxX("name","dictionary", "where type='zy'");
		C_num5.setName("employlevel");
		C_num5.setAllowBlank(false);
		C_num5.setEmptyText("这个是必填字段");
		form.add(C_num5, td);
		
		form.add(new Label("内部职位:"), td);
		in_work = new BaseComboBoxX("job_name","job_table", "where type='hr_title'");
		in_work.setName("employinnertitle");
		in_work.setAllowBlank(false);
		in_work.setEmptyText("这个是必填字段");
		in_work.addListener(Events.BeforeQuery, getListener());
		form.add(in_work, td);
		
		form.add(new Label("外部职位:"), td);
		BaseComboBoxX C_num7 = new BaseComboBoxX("name","dictionary", "where 1=2");
		C_num7.setName("employoutertitle");//内部职位与外部职位互换
		form.add(C_num7, td);
		form.add(new Label("雇佣状态:"), td);
		C_num8 = new BaseComboBoxX("name","dictionary", "where type='zyzk'");
		C_num8.setEnabled(false);
		C_num8.setName("employstatus");
		form.add(C_num8, td);
		
		form.add(new Label("入职日期:"), td);
		C_data9 = new DateField();
		C_data9.getPropertyEditor().setFormat(
				DateTimeFormat.getFormat("yyyy-MM-d"));
		C_data9.setName("entrydate");
		C_data9.setEnabled(false);
		C_data9.addListener(Events.Changed, getListener());
		form.add(C_data9, td);
		form.add(new Label("转正日期:"), td);
		C_data10 = new DateField();
		C_data10.getPropertyEditor().setFormat(
				DateTimeFormat.getFormat("yyyy-MM-dd"));
		C_data10.setEnabled(false);
		C_data10.setName("Regularizationdate");
		form.add(C_data10, td);
		form.add(new Label("集团入职日期:"), td);
		DateField C_data11 = new DateField();
		C_data11.getPropertyEditor().setFormat(
				DateTimeFormat.getFormat("yyyy-MM-dd"));
		C_data11.setName("groupregularizationdate");
		form.add(C_data11, td);
		
		form.add(new Label("工作年限:"), td);
		score = new NumberField();
		score.setEnabled(false);
		score.setName("Work_experience");
		form.add(score, td);
		
		form.add(new Label("最后工作日期:"), td);
		C_data12 = new DateField();
		C_data12.getPropertyEditor().setFormat(
				DateTimeFormat.getFormat("yyyy-MM-dd"));
		C_data12.setEnabled(false);
		C_data12.setName("lastjobdate");
		form.add(C_data12, td);

		form.add(new Label("辞职有效日期:"), td);
		C_data14 = new DateField();
		C_data14.getPropertyEditor().setFormat(
				DateTimeFormat.getFormat("yyyy-MM-dd"));
		C_data14.setEnabled(false);
		C_data14.setName("Resignationdate");
		form.add(C_data14, td);
	
		
		form.add(new Label("工作性质:"), td);
		BaseComboBoxX C_num18 = new BaseComboBoxX("name","dictionary", "where type='hr_jobproperty'");
		C_num18.setName("jobproperty");
		form.add(C_num18, td);
		form.add(new Label("工作组别:"), td);
		BaseComboBoxX C_num19 = new BaseComboBoxX("name","dictionary", "where type='hr_jobgroup'");
		C_num19.setName("jobgroup");
		form.add(C_num19, td);
		form.add(new Label("工作类别:"), td);
		C_num20 = new BaseComboBoxX("name","dictionary", "where type='hr_jobtype'");
		C_num20.setName("jobtype");
		C_num20.setAllowBlank(false);
		C_num20.setEmptyText("这个是必填字段");
		C_num20.addListener(Events.Changed, getListener());
		form.add(C_num20, td);

		form.add(new Label("考勤卡编码:"), td);
		TextField<String> C_num26 = new TextField<String>();
		C_num26.setName("attendancecardno");
		form.add(C_num26, td);
		
		form.add(new Label("储物柜编号:"), td);
		C_num24 =new BaseComboBoxX("code","hr_wardrobe","where usedcount !=1");
		C_num24.addListener(Events.Changed, getListener());
		C_num24.setName("lockersno");
		form.add(C_num24, td);
		
		form.add(new Label("实习生来源:"), td);
		bcbTrainerFrom =new BaseComboBoxX("name","dictionary","where type ='HR_StudentFrom'");
		bcbTrainerFrom.setName("trainerfrom");
		bcbTrainerFrom.setEnabled(false);
		form.add(bcbTrainerFrom, td);
		
		form.add(new Label("宿舍编号:"), td);
		TextField<String> C_num225 = new TextField<String>();
		C_num225.setName("hostelno");
		C_num225.setEnabled(false);
		form.add(C_num225, td);
		
		form.add(new Label("计加班倍数:"), td);
		String titles[] = new String[]{"是","否"};
		BaseRadioGroup isMul = new BaseRadioGroup(titles,true);
		isMul.setHeight(20);
	//	BaseComboBoxForm<BaseModelData> C_num22 = new BaseComboBoxForm<BaseModelData>("code","name","dictionary","where type = 'hr_isMul'",true);
		isMul.setName("isMul");
		form.add(isMul, td);
		
		
		
		form.add(new Label("不计考勤异常:"),td);
		String title[] = new String[]{"是","否"};
		BaseRadioGroup attendance = new BaseRadioGroup(title,true);
		attendance.setHeight(20);
		attendance.setName("isAttendance");
		form.add(attendance,td);
		
		form.add(new Label("上司:"), td);
		TextField<String> C_num23 = new TextField<String>();
		C_num23.setName("boss");
		form.add(C_num23, td);
		
		form.add(new Label("计算宿舍费用:"), td);
		String conuts[] = new String[]{"是","否"};
		BaseRadioGroup isCount = new BaseRadioGroup(conuts,true);
		isCount.setHeight(20);
		isCount.setName("isCount");
		form.add(isCount, td);

		form.inited();
		return form;
	};
/*******/
	BaseFormPanel form1;
	BaseFormPanel create_bcode_Form() {
		form1 = new BaseFormPanel(mainstore);
		form1.setBodyBorder(false);
		form1.setPadding(6);
		form1.setStyleName("form_css2");
		TableLayout tl = new TableLayout(6);

		TableData td = new TableData();
		td.setRowspan(1);
		td.setHorizontalAlign(HorizontalAlignment.LEFT);
		td.setVerticalAlign(VerticalAlignment.MIDDLE);
		td.setPadding(2);
		form1.setLayout(tl);
		form1.setHeaderVisible(false);
		
		form1.add(new Label("部门:            "), td);
		C_dep = new BaseComboBoxForm<BaseModelData>("id","name","SystemInfo","where len(id)=4",true);
		C_dep.setWidth(127);
		C_dep.setName("up_department");
		C_dep.setAllowBlank(false);
		C_dep.setEmptyText("这个是必填字段");
		C_dep.setFireChangeEventOnSetValue(true);
		form1.add(C_dep, td);
		
		form1.add(new Label("分部门:       "), td);
		C_num27= new BaseComboBoxForm<BaseModelData>("id","name","SystemInfo","where name is not null and id is not null and len(id)=(select max(len(id)) from systeminfo)",true);
		C_num27.setWidth(127);
		C_num27.setAllowBlank(false);
		C_num27.setEmptyText("这个是必填字段");
		C_num27.addListener(Events.BeforeQuery, getListener());
		C_num27.addListener(Events.Changed, getListener());
		C_num27.setName("systemid");
		form1.add(C_num27, td);
		
		form1.add(new Label("识别码:          "), td);
		C_num25 = new TextField<String>();
		C_num25.setWidth(127);
		C_num25.setEnabled(false);
		C_num25.setName("Identifier");
		C_num25.setFireChangeEventOnSetValue(true);
		form1.add(C_num25, td);
		
		form1.inited();
		return form1;
	}
	/******/
	

	


	int sync = 0;
	Listener<BaseEvent> defaultlistener;

	Listener<BaseEvent> getListener() {
		if (defaultlistener != null) {
			return defaultlistener;
		}

		defaultlistener = new Listener<BaseEvent>() {
			public void handleEvent(BaseEvent be) {
				sync++;
				try {
					if (sync == 1) {
						if (be.getType() == Events.Select) {
							if (be.getSource().equals("按钮变量")) {

							}
						} else if (be.getType() == Events.Changed) {
							if (be.getSource().equals(C_data9)) {
								set_w_date();//设置全局变量  入职日期
							}else if (be.getSource().equals(C_num27)) {
								C_num25.setFireChangeEventOnSetValue(true);
								C_num3.setFireChangeEventOnSetValue(true);
								if(C_dep.getRawValue() != null && C_num27.getRawValue() != null){
									final String department = C_num27.getValue().get("name");
									final String dep = C_dep.getValueCode();
									com.base.myproject.client.tools.Command c1 = new com.base.myproject.client.tools.Command(){
										 public void Start(){
											String sql2="select (select title from systeminfo where id=(select id from systeminfo where name='"+department+"')) as a, " +
														"(select title from systeminfo where id='"+dep+"')as b,(select id from systeminfo where name='"+department+"')as c";
												
											final com.base.myproject.client.tools.GreetingServiceAsync greetingService2 = GWT.create(com.base.myproject.client.tools.GreetingService.class);
											greetingService2.getDataSet(sql2, new AsyncCallback<DataSet>(){
												@Override
												public void onFailure(Throwable caught) {	
													Complete();
												}
												@Override
												public void onSuccess(DataSet result) {	
													C_num25.setValue(result.getValue(0, "b")+result.getValue(0, "a"));
													in_work.setFilter("where type='hr_title' and department='"+result.getValue(0, "c")+"'");
													C_num3.setValue(result.getValue(0, "b")+result.getValue(0, "a")+mainstore.getValue("bcode"));
												
													Complete();
												}
											});
										}
										};
										CommandFactory.addCommand(c1); 
								} else {
									C_num3.setRawValue("");
								}
							}
							if(be.getSource().equals(C_num24)){
								if (mainstore.getValue("bname") == null || mainstore.getValue("bname").equals("")) {
									MessageBox.alert("提示", "请输入员工姓名再进行衣柜的选择，不然统计时会出现错误，谢谢！", null);
									C_num24.setValue(null);
									return;
								}
								MessageBox.confirm("提示	", "此操作将直接把该员工与该衣柜绑定,是否继续操作？", new Listener<MessageBoxEvent> (){
									public void handleEvent(MessageBoxEvent be) {
										if(be.getButtonClicked().getText().equals(GXT.MESSAGES.messageBox_yes()))
										{//选择同意后
											CommandSyncsql csql = new CommandSyncsql();
											String code=C_num24.getValue().get("code");
											String sql1="update hr_wardrobe set usedcount=1 where code='"+code+"'";
											String sql3="update bcode_job set lockersno = '" + code + "' where bcode='"+mainstore.getValue("bcode")+"'";
											String sql2=" insert into hr_wardrode_bcode (upcode,bcode,bname) values ('"+code+"','"+mainstore.getValue("bcode")+"','" + mainstore.getValue("bname") + "')";
											csql.getV().add(sql1);
											csql.getV().add(sql2);
											csql.getV().add(sql3);
											updateward(csql);
											C_num24.setEnabled(false);
										}//否的时候
									}		
									});
							}else if(be.getSource().equals(C_num20)){
								if(C_num20.getRawValue().equals("实习生")){
									bcbTrainerFrom.setEnabled(true);
								} else {
									bcbTrainerFrom.setEnabled(false);
								}
							}
							
						} else if (be.getType() == Events.BeforeShow) {
							MessageBox.alert("", "", null);
						} else if(be.getType() == Events.BeforeQuery){
							if (be.getSource().equals(C_num27)) {
								C_num27.setSql("select id as code,name as name from systeminfo where id like '"+C_dep.getValueCode()+"__'");
							}else if(be.getSource().equals(in_work)){
								if(C_num27.getRawValue() != null){
									in_work.setFilter("where type='hr_title' and department='"+C_num27.getValueCode()+"'");
								}else{
									MessageBox.alert("提示", "请先选择分部门", null);
								}
								
							}
						}
					}
				} finally {
					sync--;
				}
			}

		};
		return defaultlistener;
	}
	ArrayList<BaseStore> refresh_list = new ArrayList<BaseStore>() ;
	void updateward(CommandSyncsql csq){	
		//String sql="  update hr_wardrobe set usedcount=1 where code='"+code+"'";	//1 表示这个柜子已经被使用
		CommandSyncsql csql = new CommandSyncsql();
		csql=csq;
			//csql.getV().add(sql);
			if(csql.getV().size()>0){
				 GreetingServiceAsync greetingService = GWT
					.create(GreetingService.class);
				 CommandSyncContainer list = new CommandSyncContainer();
				 list.add(csql);
				 greetingService
					.SendCommandSync(
							list,
							new AsyncCallback<CommandSyncReturnObject>() {
								@Override
								public void onFailure(
										Throwable caught) {
									MessageBox.alert("错误",
											"网络连接失败", null);	
								}
								@Override
								public void onSuccess(
										CommandSyncReturnObject result) {
									if (result.isB()) {
										DeferredCommand.addCommand(new Command() {
										      public void execute() {	
										    	   Info.display("提示", "操作成功!");									    	
										      }
										    });
									}
									else{
										MessageBox.alert("错误",
												"错误，错误代码"+result.getMessage(), null);
										
									}
								}
							});
			}	 
	}

	@Override
	public boolean isopen() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean open() {
		// TODO Auto-generated method stub
		return false;
	}
	public void set_w_date() {
		W_date=C_data9.getRawValue();
	}
	public String get_w_date() {
		return W_date;
	}
	
}
